package js.web.center.utils;
/**
 * 
 * @author dowell
 *
 */

import java.util.HashMap;
/**
 * 共享对象保存器
 * @author dowell
 *
 */
public class JsWebDatabaseMapUtils {
	private static HashMap<String, Object> hashMap=new HashMap<>();
	/**
	 * 获取共享对象 
	 * @param key
	 * @return
	 */
	public synchronized static Object getShareObject(String key){
		return hashMap.get(key);
	}
	/**
	 * 添加共享对象
	 * @param key
	 * @param object
	 */
	public synchronized static void addShareObject(String key,Object object){
		hashMap.put(key, object);
	}
	/**
	 * 移除共享对象
	 * @param key
	 */
	public synchronized static void removeShareObject(String key){
		hashMap.remove(key);
	}
	/**
	 * 共享对象
	 */
	public synchronized static HashMap<String, Object> getShareMap(){
		return hashMap;
	}
}
